Imports Microsoft.VisualBasic

Public Class Cons

    Public Shared sema As New Threading.Semaphore(3, 3)

    Public Shared MAX_SIMULATIONS As Integer = 5
    Public Shared MAX_TRAININGS As Integer = 15 '20 is ready
    Public Shared MAX_INJURIES As Integer = 15 '20 is ready
    Public Shared MAX_PLAYERS As Integer = 30
    Public Shared MAX_SEASONS As Integer = 15
    Public Shared MAX_WEEKS As Integer = 40

    Private Shared SEASONS As New Collection
    Private Shared AGERANGES As New Collection
    Private Shared AGERANGEVALUES As New Collection
    Private Shared PLAYERS As New Collection
    Private Shared INJURIES As New Collection
    Private Shared CATEGORIES As New Collection
    Private Shared ATTRIBUTES As New Collection
    Private Shared POSITIONS As New Collection
    Private Shared ZONES As New Collection


    Public Shared SEASON1 As String = "Season1"
    Public Shared SEASON2 As String = "Season2"
    Public Shared SEASON3 As String = "Season3"
    Public Shared SEASON4 As String = "Season4"
    Public Shared SEASON5 As String = "Season5"
    Public Shared SEASON6 As String = "Season6"
    Public Shared SEASON7 As String = "Season7"
    Public Shared SEASON8 As String = "Season8"
    Public Shared SEASON9 As String = "Season9"
    Public Shared SEASON10 As String = "Season10"
    Public Shared SEASON11 As String = "Season11"
    Public Shared SEASON12 As String = "Season12"
    Public Shared SEASON13 As String = "Season13"
    Public Shared SEASON14 As String = "Season14"
    Public Shared SEASON15 As String = "Season15"


    Private Shared Sub LOAD_SEASONS()
        SEASONS.Clear()
        SEASONS.Add(SEASON1)
        SEASONS.Add(SEASON2)
        SEASONS.Add(SEASON3)
        SEASONS.Add(SEASON4)
        SEASONS.Add(SEASON5)
        SEASONS.Add(SEASON6)
        SEASONS.Add(SEASON7)
        SEASONS.Add(SEASON8)
        SEASONS.Add(SEASON9)
        SEASONS.Add(SEASON10)
        SEASONS.Add(SEASON11)
        SEASONS.Add(SEASON12)
        SEASONS.Add(SEASON13)
        SEASONS.Add(SEASON14)
        SEASONS.Add(SEASON15)

    End Sub

    Public Shared Function GET_SEASONS() As Collection
        LOAD_SEASONS()
        Return SEASONS
    End Function


    Public Shared AGERANGE1 As String = "AgeRange1"  'Age<16
    Public Shared AGERANGE2 As String = "AgeRange2"  '16<=Age<20
    Public Shared AGERANGE3 As String = "AgeRange3"  '20<=Age<25
    Public Shared AGERANGE4 As String = "AgeRange4"  '25<=Age<30
    Public Shared AGERANGE5 As String = "AgeRange5"  '30<=Age<35
    Public Shared AGERANGE6 As String = "AgeRange6"  '35<=Age<40
    Public Shared AGERANGE7 As String = "AgeRange7"  'Age>=40


    Private Shared Sub LOAD_AGERANGES()
        AGERANGES.Clear()
        AGERANGES.Add(AGERANGE1)
        AGERANGES.Add(AGERANGE2)
        AGERANGES.Add(AGERANGE3)
        AGERANGES.Add(AGERANGE4)
        AGERANGES.Add(AGERANGE5)
        AGERANGES.Add(AGERANGE6)
        AGERANGES.Add(AGERANGE7)


    End Sub

    Public Shared Function GET_AGERANGES() As Collection
        LOAD_AGERANGES()
        Return AGERANGES
    End Function

    Public Shared AGERANGEVAL1 As String = "Age GTE 30"  'retire after 30
    Public Shared AGERANGEVAL2 As String = "Age GTE 35"  'retire after 35
    Public Shared AGERANGEVAL3 As String = "Age GTE 40"  'retire after 40


    Private Shared Sub LOAD_AGERANGEVALUES()
        AGERANGEVALUES.Clear()
        AGERANGEVALUES.Add(AGERANGEVAL1)
        AGERANGEVALUES.Add(AGERANGEVAL2)
        AGERANGEVALUES.Add(AGERANGEVAL3)


    End Sub

    Public Shared Function GET_AGERANGEVALUES() As Collection
        LOAD_AGERANGEVALUES()
        Return AGERANGEVALUES
    End Function


    Public Shared PLAYER1 As String = "Player1"
    Public Shared PLAYER2 As String = "Player2"
    Public Shared PLAYER3 As String = "Player3"
    Public Shared PLAYER4 As String = "Player4"
    Public Shared PLAYER5 As String = "Player5"
    Public Shared PLAYER6 As String = "Player6"
    Public Shared PLAYER7 As String = "Player7"
    Public Shared PLAYER8 As String = "Player8"
    Public Shared PLAYER9 As String = "Player9"
    Public Shared PLAYER10 As String = "Player10"
    Public Shared PLAYER11 As String = "Player11"
    Public Shared PLAYER12 As String = "Player12"
    Public Shared PLAYER13 As String = "Player13"
    Public Shared PLAYER14 As String = "Player14"
    Public Shared PLAYER15 As String = "Player15"
    Public Shared PLAYER16 As String = "Player16"
    Public Shared PLAYER17 As String = "Player17"
    Public Shared PLAYER18 As String = "Player18"
    Public Shared PLAYER19 As String = "Player19"
    Public Shared PLAYER20 As String = "Player20"
    Public Shared PLAYER21 As String = "Player21"
    Public Shared PLAYER22 As String = "Player22"
    Public Shared PLAYER23 As String = "Player23"
    Public Shared PLAYER24 As String = "Player24"
    Public Shared PLAYER25 As String = "Player25"
    Public Shared PLAYER26 As String = "Player26"
    Public Shared PLAYER27 As String = "Player27"
    Public Shared PLAYER28 As String = "Player28"
    Public Shared PLAYER29 As String = "Player29"
    Public Shared PLAYER30 As String = "Player30"


    Private Shared Sub LOAD_PLAYERS()
        PLAYERS.Clear()
        PLAYERS.Add(PLAYER1)
        PLAYERS.Add(PLAYER2)
        PLAYERS.Add(PLAYER3)
        PLAYERS.Add(PLAYER4)
        PLAYERS.Add(PLAYER5)
        PLAYERS.Add(PLAYER6)
        PLAYERS.Add(PLAYER7)
        PLAYERS.Add(PLAYER8)
        PLAYERS.Add(PLAYER9)
        PLAYERS.Add(PLAYER10)
        PLAYERS.Add(PLAYER11)
        PLAYERS.Add(PLAYER12)
        PLAYERS.Add(PLAYER13)
        PLAYERS.Add(PLAYER14)
        PLAYERS.Add(PLAYER15)
        PLAYERS.Add(PLAYER16)
        PLAYERS.Add(PLAYER17)
        PLAYERS.Add(PLAYER18)
        PLAYERS.Add(PLAYER19)
        PLAYERS.Add(PLAYER20)
        PLAYERS.Add(PLAYER21)
        PLAYERS.Add(PLAYER22)
        PLAYERS.Add(PLAYER23)
        PLAYERS.Add(PLAYER24)
        PLAYERS.Add(PLAYER25)
        PLAYERS.Add(PLAYER26)
        PLAYERS.Add(PLAYER27)
        PLAYERS.Add(PLAYER28)
        PLAYERS.Add(PLAYER29)
        PLAYERS.Add(PLAYER30)
    End Sub

    Public Shared Function GET_PLAYERS() As Collection
        LOAD_PLAYERS()
        Return PLAYERS
    End Function
  

    Public Shared INJURY1 As String = "Injury1"
    Public Shared INJURY2 As String = "Injury2"
    Public Shared INJURY3 As String = "Injury3"
    Public Shared INJURY4 As String = "Injury4"
    Public Shared INJURY5 As String = "Injury5"
    Public Shared INJURY6 As String = "Injury6"
    Public Shared INJURY7 As String = "Injury7"
    Public Shared INJURY8 As String = "Injury8"
    Public Shared INJURY9 As String = "Injury9"
    Public Shared INJURY10 As String = "Injury10"
    Public Shared INJURY11 As String = "Injury11"
    Public Shared INJURY12 As String = "Injury12"
    Public Shared INJURY13 As String = "Injury13"
    Public Shared INJURY14 As String = "Injury14"
    Public Shared INJURY15 As String = "Injury15"
    Public Shared INJURY16 As String = "Injury16"
    Public Shared INJURY17 As String = "Injury17"
    Public Shared INJURY18 As String = "Injury18"
    Public Shared INJURY19 As String = "Injury19"
    Public Shared INJURY20 As String = "Injury20"

    Private Shared Sub LOAD_INJURIES()
        INJURIES.Clear()
        INJURIES.Add(INJURY1)
        INJURIES.Add(INJURY2)
        INJURIES.Add(INJURY3)
        INJURIES.Add(INJURY4)
        INJURIES.Add(INJURY5)
        INJURIES.Add(INJURY6)
        INJURIES.Add(INJURY7)
        INJURIES.Add(INJURY8)
        INJURIES.Add(INJURY9)
        INJURIES.Add(INJURY10)
        INJURIES.Add(INJURY11)
        INJURIES.Add(INJURY12)
        INJURIES.Add(INJURY13)
        INJURIES.Add(INJURY14)
        INJURIES.Add(INJURY15)
        INJURIES.Add(INJURY16)
        INJURIES.Add(INJURY17)
        INJURIES.Add(INJURY18)
        INJURIES.Add(INJURY19)
        INJURIES.Add(INJURY20)

    End Sub
    Public Shared Function GET_INJURIES() As Collection
        LOAD_INJURIES()
        Return INJURIES
    End Function

    Public Shared NONE As String = "NONE"
    Public Shared EMPTY As String = ""
  

    Public Shared TRAINING_TYPE_Attribute = "Attribute"
    Public Shared TRAINING_TYPE_Category = "Category"

    Public Shared TRAINING_AFFECTING_Positions = "Positions"
    Public Shared TRAINING_AFFECTING_Zones = "Zones"


    Public Shared CATEGORY_Attacking As String = "Attacking"
    Public Shared CATEGORY_Power As String = "Power"
    Public Shared CATEGORY_Mentality As String = "Mentality"
    Public Shared CATEGORY_Skill As String = "Skill"
    Public Shared CATEGORY_Movement As String = "Movement"
    Public Shared CATEGORY_Defending As String = "Defending"
    Public Shared CATEGORY_Goal_Keeping As String = "Goal Keeping"


    Private Shared Sub LOAD_CATEGORIES()
        CATEGORIES.Clear()
        CATEGORIES.Add(CATEGORY_Attacking)
        CATEGORIES.Add(CATEGORY_Power)
        CATEGORIES.Add(CATEGORY_Mentality)
        CATEGORIES.Add(CATEGORY_Skill)
        CATEGORIES.Add(CATEGORY_Movement)
        CATEGORIES.Add(CATEGORY_Defending)
        CATEGORIES.Add(CATEGORY_Goal_Keeping)

    End Sub
    Public Shared Function GET_CATEGORIES() As Collection
        LOAD_CATEGORIES()
        Return CATEGORIES
    End Function


    Public Shared ATTRIBUTE_Crossing As String = "Crossing"
    Public Shared ATTRIBUTE_Finishing As String = "Finishing"
    Public Shared ATTRIBUTE_Heading As String = "Heading"
    Public Shared ATTRIBUTE_Short_Pass As String = "Short Pass"
    Public Shared ATTRIBUTE_Volleys As String = "Volleys"

    Public Shared ATTRIBUTE_Shot_Power As String = "Shot Power"
    Public Shared ATTRIBUTE_Jumping As String = "Jumping"
    Public Shared ATTRIBUTE_Stamina As String = "Stamina"
    Public Shared ATTRIBUTE_Strength As String = "Strength"
    Public Shared ATTRIBUTE_Long_Shot As String = "Long Shot"

    Public Shared ATTRIBUTE_Aggression As String = "Aggression"
    Public Shared ATTRIBUTE_Tactical_Awareness As String = "Tactical Awareness"
    Public Shared ATTRIBUTE_Positioning As String = "Positioning"
    Public Shared ATTRIBUTE_Vision As String = "Vision"
    Public Shared ATTRIBUTE_Penalties As String = "Penalties"

    Public Shared ATTRIBUTE_Curve As String = "Curve"
    Public Shared ATTRIBUTE_Dribbling As String = "Dribbling"
    Public Shared ATTRIBUTE_Freekick As String = "Freekick"
    Public Shared ATTRIBUTE_Long_Pass As String = "Long Pass"
    Public Shared ATTRIBUTE_Ball_Control As String = "Ball Control"

    Public Shared ATTRIBUTE_Acceleration As String = "Acceleration"
    Public Shared ATTRIBUTE_Agility As String = "Agility"
    Public Shared ATTRIBUTE_Sprint As String = "Sprint"
    Public Shared ATTRIBUTE_Balance As String = "Balance"
    Public Shared ATTRIBUTE_Reactions As String = "Reactions"

    Public Shared ATTRIBUTE_Marking As String = "Marking"
    Public Shared ATTRIBUTE_Slide_Tackle As String = "Slide Tackle"
    Public Shared ATTRIBUTE_Standing_Tackle As String = "Standing Tackle"

    Public Shared ATTRIBUTE_Diving As String = "Diving"
    Public Shared ATTRIBUTE_Handling As String = "Handling"
    Public Shared ATTRIBUTE_Kicking As String = "Kicking"
    Public Shared ATTRIBUTE_One_On_One As String = "One On One"
    Public Shared ATTRIBUTE_Reflexes As String = "Reflexes"



    Private Shared Sub LOAD_ATTRIBUTES()
        ATTRIBUTES.Clear()
        ATTRIBUTES.Add(ATTRIBUTE_Crossing)
        ATTRIBUTES.Add(ATTRIBUTE_Finishing)
        ATTRIBUTES.Add(ATTRIBUTE_Heading)
        ATTRIBUTES.Add(ATTRIBUTE_Short_Pass)
        ATTRIBUTES.Add(ATTRIBUTE_Volleys)
        ATTRIBUTES.Add(ATTRIBUTE_Shot_Power)
        ATTRIBUTES.Add(ATTRIBUTE_Jumping)
        ATTRIBUTES.Add(ATTRIBUTE_Stamina)
        ATTRIBUTES.Add(ATTRIBUTE_Strength)
        ATTRIBUTES.Add(ATTRIBUTE_Long_Shot)
        ATTRIBUTES.Add(ATTRIBUTE_Aggression)
        ATTRIBUTES.Add(ATTRIBUTE_Tactical_Awareness)
        ATTRIBUTES.Add(ATTRIBUTE_Positioning)
        ATTRIBUTES.Add(ATTRIBUTE_Vision)
        ATTRIBUTES.Add(ATTRIBUTE_Penalties)
        ATTRIBUTES.Add(ATTRIBUTE_Curve)
        ATTRIBUTES.Add(ATTRIBUTE_Dribbling)
        ATTRIBUTES.Add(ATTRIBUTE_Freekick)
        ATTRIBUTES.Add(ATTRIBUTE_Long_Pass)
        ATTRIBUTES.Add(ATTRIBUTE_Ball_Control)
        ATTRIBUTES.Add(ATTRIBUTE_Acceleration)
        ATTRIBUTES.Add(ATTRIBUTE_Agility)
        ATTRIBUTES.Add(ATTRIBUTE_Sprint)
        ATTRIBUTES.Add(ATTRIBUTE_Balance)
        ATTRIBUTES.Add(ATTRIBUTE_Reactions)
        ATTRIBUTES.Add(ATTRIBUTE_Marking)
        ATTRIBUTES.Add(ATTRIBUTE_Slide_Tackle)
        ATTRIBUTES.Add(ATTRIBUTE_Standing_Tackle)
        ATTRIBUTES.Add(ATTRIBUTE_Diving)
        ATTRIBUTES.Add(ATTRIBUTE_Handling)
        ATTRIBUTES.Add(ATTRIBUTE_Kicking)
        ATTRIBUTES.Add(ATTRIBUTE_One_On_One)
        ATTRIBUTES.Add(ATTRIBUTE_Reflexes)

    End Sub
    Public Shared Function GET_ATTRIBUTES() As Collection
        LOAD_ATTRIBUTES()
        Return ATTRIBUTES
    End Function


    Public Shared POSITION_GK As String = "GK"
    Public Shared POSITION_SW As String = "SW"
    Public Shared POSITION_RB As String = "RB"
    Public Shared POSITION_RWB As String = "RWB"
    Public Shared POSITION_RCB As String = "RCB"
    Public Shared POSITION_CB As String = "CB"
    Public Shared POSITION_LCB As String = "LCB"
    Public Shared POSITION_LWB As String = "LWB"
    Public Shared POSITION_LB As String = "LB"

    Public Shared POSITION_RM As String = "RM"
    Public Shared POSITION_RAM As String = "RAM"
    Public Shared POSITION_RCM As String = "RCM"
    Public Shared POSITION_RDM As String = "RDM"
    Public Shared POSITION_CM As String = "CM"
    Public Shared POSITION_CAM As String = "CAM"
    Public Shared POSITION_CDM As String = "CDM"
    Public Shared POSITION_LDM As String = "LDM"
    Public Shared POSITION_LCM As String = "LCM"
    Public Shared POSITION_LAM As String = "LAM"
    Public Shared POSITION_LM As String = "LM"

    Public Shared POSITION_RW As String = "RW"
    Public Shared POSITION_RF As String = "RF"
    Public Shared POSITION_RS As String = "RS"
    Public Shared POSITION_CF As String = "CF"
    Public Shared POSITION_ST As String = "ST"
    Public Shared POSITION_LS As String = "LS"
    Public Shared POSITION_LF As String = "LF"
    Public Shared POSITION_LW As String = "LW"



    Private Shared Sub LOAD_POSITIONS()
        POSITIONS.Clear()
        POSITIONS.Add(POSITION_GK)
        POSITIONS.Add(POSITION_SW)
        POSITIONS.Add(POSITION_RB)
        POSITIONS.Add(POSITION_RWB)
        POSITIONS.Add(POSITION_RCB)
        POSITIONS.Add(POSITION_CB)
        POSITIONS.Add(POSITION_LCB)
        POSITIONS.Add(POSITION_LWB)
        POSITIONS.Add(POSITION_LB)
        POSITIONS.Add(POSITION_RM)
        POSITIONS.Add(POSITION_RAM)
        POSITIONS.Add(POSITION_RCM)
        POSITIONS.Add(POSITION_RDM)
        POSITIONS.Add(POSITION_CM)
        POSITIONS.Add(POSITION_CAM)
        POSITIONS.Add(POSITION_CDM)
        POSITIONS.Add(POSITION_LDM)
        POSITIONS.Add(POSITION_LCM)
        POSITIONS.Add(POSITION_LAM)
        POSITIONS.Add(POSITION_LM)
        POSITIONS.Add(POSITION_RW)
        POSITIONS.Add(POSITION_RF)
        POSITIONS.Add(POSITION_RS)
        POSITIONS.Add(POSITION_CF)
        POSITIONS.Add(POSITION_ST)
        POSITIONS.Add(POSITION_LS)
        POSITIONS.Add(POSITION_LF)
        POSITIONS.Add(POSITION_LW)

    End Sub
    Public Shared Function GET_POSITIONS() As Collection
        LOAD_POSITIONS()
        Return POSITIONS
    End Function


    Public Shared ZONE_Keeper As String = "Keeper"
    Public Shared ZONE_Defense As String = "Defense"
    Public Shared ZONE_Midfield As String = "Midfield"
    Public Shared ZONE_Forward As String = "Forward"

    Private Shared Sub LOAD_ZONES()
        ZONES.Clear()
        ZONES.Add(ZONE_Keeper)
        ZONES.Add(ZONE_Defense)
        ZONES.Add(ZONE_Midfield)
        ZONES.Add(ZONE_Forward)
    End Sub

    Public Shared Function GET_ZONES() As Collection
        LOAD_ZONES()
        Return ZONES
    End Function


    Public Shared Function GET_ATTRIBUTES_FOR_CATEGORY(ByVal category As String) As Collection

        Dim col As New Collection

        Select Case (category)


            Case CATEGORY_Attacking
                col.Add(ATTRIBUTE_Crossing)
                col.Add(ATTRIBUTE_Finishing)
                col.Add(ATTRIBUTE_Heading)
                col.Add(ATTRIBUTE_Short_Pass)
                col.Add(ATTRIBUTE_Volleys)

            Case CATEGORY_Defending
                col.Add(ATTRIBUTE_Marking)
                col.Add(ATTRIBUTE_Slide_Tackle)
                col.Add(ATTRIBUTE_Standing_Tackle)

            Case CATEGORY_Goal_Keeping
                col.Add(ATTRIBUTE_Diving)
                col.Add(ATTRIBUTE_Handling)
                col.Add(ATTRIBUTE_Kicking)
                col.Add(ATTRIBUTE_One_On_One)
                col.Add(ATTRIBUTE_Reflexes)

            Case CATEGORY_Mentality
                col.Add(ATTRIBUTE_Aggression)
                col.Add(ATTRIBUTE_Tactical_Awareness)
                col.Add(ATTRIBUTE_Positioning)
                col.Add(ATTRIBUTE_Vision)
                col.Add(ATTRIBUTE_Penalties)

            Case CATEGORY_Movement
                col.Add(ATTRIBUTE_Acceleration)
                col.Add(ATTRIBUTE_Agility)
                col.Add(ATTRIBUTE_Sprint)
                col.Add(ATTRIBUTE_Balance)
                col.Add(ATTRIBUTE_Reactions)

            Case CATEGORY_Power
                col.Add(ATTRIBUTE_Shot_Power)
                col.Add(ATTRIBUTE_Jumping)
                col.Add(ATTRIBUTE_Stamina)
                col.Add(ATTRIBUTE_Strength)
                col.Add(ATTRIBUTE_Long_Shot)

            Case CATEGORY_Skill
                col.Add(ATTRIBUTE_Curve)
                col.Add(ATTRIBUTE_Dribbling)
                col.Add(ATTRIBUTE_Freekick)
                col.Add(ATTRIBUTE_Long_Pass)
                col.Add(ATTRIBUTE_Ball_Control)

        End Select


        Return col
    End Function


    Public Shared PLAYER_STATUS_ACTIVE As String = "Active"
    Public Shared PLAYER_STATUS_RETIRED As String = "Retired"

    'validation errors

    Public Shared VALIDATION_ERROR_INVALID_AgeRangeSum = "The Age Ranges must sum up to 100%."
    Public Shared VALIDATION_ERROR_INVALID_AgeRangeValue = "The Age Range must be a whole integer between 0 and 100 inclusively."

    Public Shared VALIDATION_ERROR_INVALID_IntegerValue = "The Age Range must be a whole integer between 0 and 100 inclusively."

    Public Shared VALIDATION_ERROR_INVALID_NameValue = "The Name must be contain Letters and/or Numbers."

    Public Shared VALIDATION_ERROR_INVALID_DescValue = "The Desc cannot be empty."
    Public Shared VALIDATION_ERROR_INVALID_RecoveryWeeksValue = "Recovery weeks cannot be less than 0."


End Class
